package com.zdky.tpl.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.CountDownLatch;

/**
 * 用来处理支付订单相关
 */
@Component
public class ConsumerForPay {


    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private CountDownLatch countDownLatch;

    @Autowired
    private ConsumerProcessor consumerProcessor;

    /**
     * 处理支付相关
     */
    public void payHandle(String msg){
        System.err.println("支付消费者已接收到信息："+msg);
        consumerProcessor.core(msg);
     //    计数，减一
        countDownLatch.countDown();
    }
}
